#include<stdio.h>
int main()
{
	int y,m,d,days=0;
	int i=1,n=0,t=0;
	printf("请输入年,月,日：");
	scanf("%d,%d,%d",&y,&m,&d);
	
	for(i=1;i<=y-1;i++)      //统计过去的整年中闰年个数n
	{
		if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
			n++;
	}
	days=(y-1) * 365 + n;
	
	for(i=1;i<=m-1;i++)           //确定i月份的天数
	{
		switch(i)
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12: t=31; break;
		case 4:
		case 6:
		case 9:
		case 11: t=30; break;      //switch case直接滑下来，计算本年已过去月份的天数
		case 2:
			if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
				t=29;
			else
				t=28;
		case 0: t=0;
		}
		days=days+t;
	}
	days=days+d-1;
	printf("这一天距离公元一年一月一日有 %d 天",days);
	return 0;
}
